﻿using Abp.Domain.Entities;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace GN.Pay.Core.Entities
{
    /// <summary>
    /// 商户会员银行卡
    /// </summary>
    [Table("Merchant_MemberBankCard")]
    [Serializable]
    public class MerchantMemberBankCard : Entity<long>
    {
        /// <summary>
        /// 支付内部会员Id
        /// </summary>
        [Required]
        [MaxLength(32)]
        public string MemberId { get; set; }

        /// <summary>
        /// 银行编号
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string BankNo { get; set; }

        /// <summary>
        /// 支付通道
        /// </summary>
        [Required]
        [MaxLength(32)]
        public string ChannelId { get; set; }

        /// <summary>
        /// 卡号或账号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string AccountNo { get; set; }

        /// <summary>
        /// 户名
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string AccountName { get; set; }

        /// <summary>
        /// 身份证号
        /// </summary>
        [Required]
        [MaxLength(30)]
        public string IdentityNo { get; set; }

        /// <summary>
        /// 账户类型(借记或贷记,常量组 = 1)
        /// </summary>
        public int AccountType { get; set; }

        /// <summary>
        /// 开户行名称
        /// </summary>
        [MaxLength(50)]
        public string OpenBankName { get; set; }

        /// <summary>
        /// 开户行省份
        /// </summary>
        [MaxLength(50)]
        public string OpenBankProvince { get; set; }

        /// <summary>
        /// 开户行所在城市
        /// </summary>
        [MaxLength(20)]
        public string OpenBankCity { get; set; }

        /// <summary>
        /// 预留手机号
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string MobilePhone { get; set; }

        /// <summary>
        /// 信用卡有效期
        /// </summary>
        [MaxLength(20)]
        public string CreditCardLastTerm { get; set; }

        /// <summary>
        /// 信用卡尾号
        /// </summary>
        [MaxLength(20)]
        public string CreditCardLastNo { get; set; }

        /// <summary>
        /// 协议号
        /// </summary>
        [MaxLength(100)]
        public string ProtocolNo { get; set; }

        /// <summary>
        /// 通道会员编码
        /// </summary>
        [MaxLength(100)]
        public string ChannelMemberNo { get; set; }

        /// <summary>
        /// 状态(1=绑定,-1=解绑,0=失效)
        /// </summary>
        public int State { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime OperationTime { get; set; }
    }
}
